<template>
    <div id="app">
        <keep-alive>
          <router-view v-if="$route.meta.keepAlive"/>
        </keep-alive>
        <router-view v-if="!$route.meta.keepAlive"/>
    </div>
</template>

<script>
import fixedInput from '@/utils/mixins'
import { Locale } from 'vant'
import enUS from 'vant/es/locale/lang/en-US'
import zhCN from 'vant/es/locale/lang/zh-CN'
export default {
  name: 'Home',
  mixins: [fixedInput],
  components: {
      // MainFramework,
  },
  data () {
      return {
          title: '首页',
          teamname: '未登录!',
          chinaName: '管理员',
      };
  },
  created: function () {
    if(sessionStorage.getItem('language') === 'en-US') {
      Locale.use('en-US', enUS)
    }
    else {
      Locale.use('zh-CN', zhCN)
      this.value = '中文'
    }
  },
  updated() {
    document.querySelectorAll("input").forEach(item => {
      item.onblur = this.temporaryRepair;
      window.scrollTo(0, 0);
    });
    document.querySelectorAll("select").forEach(item => {
      item.onblur = this.temporaryRepair;
      window.scrollTo(0, 0);
    });
    document.querySelectorAll("textarea").forEach(item => {
      item.onblur = this.temporaryRepair;
      window.scrollTo(0, 0);
    });
  }
}
</script>

<style>
#app {
    font-size: 3.889vw;
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #fff;
}

body {
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: constant(safe-area-inset-left);
    padding-left: env(safe-area-inset-left);
    padding-right: constant(safe-area-inset-right);
    padding-right: env(safe-area-inset-right);
}

#nav {
    padding: 30px;
}

#nav a {
    font-weight: bold;
    color: #2c3e50;
}

#nav a.router-link-exact-active {
    color: #42b983;
}

@font-face {
    font-family: "my-icon";
    src: url("./assets/font/iconfont.ttf") format("truetype");
}

.my-icon {
    position: relative;
    display: inline-block;
    font: normal normal normal 14px/1 "my-icon";
    font-size: inherit;
    text-rendering: auto;
}

.padding-right {
  padding-right: 10px;
}
.weight {
  font-weight: 600;
}
</style>
